@page {
-fs-flow-top: "header";
-fs-flow-bottom: "footer";
-fs-flow-left: "left";
-fs-flow-right: "right";
}

#header {
    font-size: 100%; font-style: italic;
    position: absolute; top: 0; left: 0;
    -fs-move-to-flow: "header";
}

#footer {
    font-size: 100%; font-style: italic;
    position: absolute; 
    -fs-move-to-flow: "footer";
}

#pagenumber:before {
    content: counter(page);
}

#pagecount:before {
    content: counter(pages);
}